package Vue;

import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.util.Observable;
import java.util.Observer;

import javax.swing.JFrame;
import javax.swing.JPanel;

import Modele.Partie;

public class Vue extends JFrame implements Observer {

	public final static CardLayout layout = new CardLayout();
	public static JPanel panelPrincipal = new JPanel(layout);
	public static Partie partie;

	public Vue(Partie p) {
		partie = p;
		setSize(new Dimension(1366, 768));
		setTitle("Diplomacy");
		setUndecorated(true);
		Image icone = Toolkit.getDefaultToolkit().getImage("./src/Images/diplomacy_logo.png");
		setIconImage(icone);
		panelPrincipal.add(new Accueil(partie), "Accueil");
		panelPrincipal.add(new CreerPartieReseau(partie), "CreerPartieReseau");
		panelPrincipal.add(new Jeu(partie), "Jeu");
		layout.first(panelPrincipal);
		add(panelPrincipal);
		pack();
	}

	@Override
	public void update(Observable arg0, Object arg1) {
		// TODO Auto-generated method stub
	}

	public static void changeFenetre(String nomFenetre) {
		layout.show(panelPrincipal, nomFenetre);
	}

}
